import '@2473o/alexui/dist/style.css'
import './assets/main.scss'

import { i18n } from './i18n'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
// import fetchAsyncRoutes from '@/router/asyncRoutes'

import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import 'dayjs/locale/zh-tw'
import 'dayjs/locale/ja'
import 'dayjs/locale/en'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime)
dayjs.locale(localStorage.getItem('localeLang') || 'zh-cn')

import AlexUI from '@2473o/alexui/dist/alexui.js'

import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
const pinia = createPinia()
pinia.use(piniaPersist)

const app = createApp(App)

app.config.globalProperties.dayjs = dayjs

app.use(i18n)
app.use(pinia)
app.use(AlexUI)

// fetchAsyncRoutes(routes, router).then(() => {
app.use(router)
app.mount('#app')
// })
